package com.yanqu.road.server.cmd.player;

import com.yanqu.road.pb.manor.FishPondProto;
import com.yanqu.road.server.cmd.CrossCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.logic.MessageHelper;
import com.yanqu.road.utils.YanQuMessageUtils;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.ClientProtocol;
import com.yanqu.road.server.protocol.CrossProtocol;

/**
 * @author ：zfr
 * @date ：2021/10/31 7:47
 */
@Cmd(code = CrossProtocol.C_CROSS_VISIT_PLAYER_FISH_POND_RESP, desc = "跨服拜访其他玩家鱼塘响应")
public class CrossVisitPlayerFishPondRespCmd extends CrossCommand {
    private FishPondProto.CrossVisitOtherFishPondRespMsg msg;

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        msg = FishPondProto.CrossVisitOtherFishPondRespMsg.parseFrom(packet.getBytes());
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {
        YanQuMessage message = YanQuMessageUtils.buildMessage(ClientProtocol.U_FISH_POND_VISIT_OTHER, msg.getMsg());
        MessageHelper.sendPacket(msg.getOriginServerId(), msg.getOriginPlayerId(), message);
    }

    @Override
    public void sendData() {

    }
}
